<!DOCTYPE html><!--HTML5 doctype-->
<html>
<head>
<title>jqMobi Kitchen Sink</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> 
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes" />
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">

</head>
<body>
    <header>
        <a id="backButton" onclick="$.ui.goBack()" class='icon back' style='display:block;left:0px;left:auto;overflow:hidden'></a>
        <h1>新建面板</h1>
    </header>
	You can use this command to add a new div programatically.  This will setup scrolling, etc.
	<pre>
	$.ui.addContentDiv(id, content,title
	, pullToRefresh, refreshFunc)
	</pre>
	<script type="text/javascript" charset="utf-8" src="js/jq.util.table.js"></script> 
	<script>
	function rowClickHandler(evt){
		var td = event.srcElement; // 通过event.srcElement 获取激活事件的对象 td 
		if(td.tagName.toLowerCase() == 'td'){
			//alert("行号：" + (td.parentElement.rowIndex) + "，内容：" + td.innerText); 
			var mytable = $(this);
			console.log(mytable.row(td.parentElement));
			setDiv(mytable.row(td.parentElement));
			$.ui.loadContent("#klsfj",false,true)
			
		}
	}
	
	function myClickHandler2(){
			alert("ddddd");
			
			var contentDiv = document.getElementById("content");;
			var myDiv= document.getElementById("myAddedDiv");
			if(myDiv)contentDiv.removeChild(myDiv);
			var mydiv = $('<div></div>');
			var mytable = $('<table id="mytable"><thead><tr><th>Check</th><th>Col1</th><th>Col2</th></tr></thead><tbody></tbody></table>');
			var aray = ['<input type="checkbox" name="slafjsla_1" >',"my","dd"];
			mytable.children('tbody').addRow(aray);
			mytable.children('tbody').insertRow(0,['<input type="checkbox" name="slafjsla_1" ></input>','<input name="slafjsla_1" ></input>','sldfjl']);
			//var str = '<table>'+mytable.html()+'</table>';
			console.log(mytable.get(0).outerHTML);
			
			$.ui.addContentDiv("myAddedDiv",mytable.get(0).outerHTML,"Added Div");
			$.ui.loadContent("#myAddedDiv");
				
			mytable = document.getElementById("mytable");
			mytable.addEventListener('click', rowClickHandler, false);
	}
		
	//var btn = document.getElementById("addContentButton");
	//document.addEventListener('click', myClickHandler, false);
	



	
	</script>
    <footer>
      <a id='addContentButton' class="icon search" onclick="javascript:myClickHandler2();" data-ignore="true">Add Content Div</a>
    </footer>



		
</body>
</html>